home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / CIncludes / Resources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-01-29  |  5.2 KB  |  180 lines  |  [TEXT/MPS ]

  1.  
  2. /************************************************************
  3.  
  4. Created: Thursday, September 12, 1991 at 2:49 PM
  5.  Resources.h
  6.  C Interface to the Macintosh Libraries
  7.  
  8.  
  9.   Copyright Apple Computer, Inc. 1985-1991
  10.   All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __RESOURCES__
  16. #define __RESOURCES__
  17.  
  18. #ifndef __TYPES__
  19. #include <Types.h>
  20. #endif
  21.  
  22. #ifndef __FILES__
  23. #include <Files.h>
  24. #endif
  25.  
  26.  
  27. enum {
  28.  
  29.  resSysHeap = 64,        /*System or application heap?*/
  30.  resPurgeable = 32,        /*Purgeable resource?*/
  31.  resLocked = 16,        /*Load it in locked?*/
  32.  resProtected = 8,        /*Protected?*/
  33.  resPreload = 4,        /*Load in on OpenResFile?*/
  34.  resChanged = 2,        /*Resource changed?*/
  35.  mapReadOnly = 128,        /*Resource file read-only*/
  36.  mapCompact = 64,        /*Compact resource file*/
  37.  mapChanged = 32,        /*Write map out at updat*/
  38.  
  39. /* Values for setting RomMapInsert and TmpResLoad */
  40.  mapTrue = 0xFFFF,        /*insert ROM map w/ TmpResLoad = TRUE.*/
  41.  mapFalse = 0xFF00        /*insert ROM map w/ TmpResLoad = FALSE.*/
  42. };
  43.  
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. pascal short InitResources(void)
  48.  = 0xA995; 
  49. pascal void RsrcZoneInit(void)
  50.  = 0xA996; 
  51. pascal void CloseResFile(short refNum)
  52.  = 0xA99A; 
  53. pascal short ResError(void)
  54.  = 0xA9AF; 
  55. pascal short CurResFile(void)
  56.  = 0xA994; 
  57. pascal short HomeResFile(Handle theResource)
  58.  = 0xA9A4; 
  59. pascal void CreateResFile(ConstStr255Param fileName)
  60.  = 0xA9B1; 
  61. pascal short OpenResFile(ConstStr255Param fileName)
  62.  = 0xA997; 
  63. pascal void UseResFile(short refNum)
  64.  = 0xA998; 
  65. pascal short CountTypes(void)
  66.  = 0xA99E; 
  67. pascal short Count1Types(void)
  68.  = 0xA81C; 
  69. pascal void GetIndType(ResType *theType,short index)
  70.  = 0xA99F; 
  71. pascal void Get1IndType(ResType *theType,short index)
  72.  = 0xA80F; 
  73. pascal void SetResLoad(Boolean load)
  74.  = 0xA99B; 
  75. pascal short CountResources(ResType theType)
  76.  = 0xA99C; 
  77. pascal short Count1Resources(ResType theType)
  78.  = 0xA80D; 
  79. pascal Handle GetIndResource(ResType theType,short index)
  80.  = 0xA99D; 
  81. pascal Handle Get1IndResource(ResType theType,short index)
  82.  = 0xA80E; 
  83. pascal Handle GetResource(ResType theType,short theID)
  84.  = 0xA9A0; 
  85. pascal Handle Get1Resource(ResType theType,short theID)
  86.  = 0xA81F; 
  87. pascal Handle GetNamedResource(ResType theType,ConstStr255Param name)
  88.  = 0xA9A1; 
  89. pascal Handle Get1NamedResource(ResType theType,ConstStr255Param name)
  90.  = 0xA820; 
  91. pascal void LoadResource(Handle theResource)
  92.  = 0xA9A2; 
  93. pascal void ReleaseResource(Handle theResource)
  94.  = 0xA9A3; 
  95. pascal void DetachResource(Handle theResource)
  96.  = 0xA992; 
  97. pascal short UniqueID(ResType theType)
  98.  = 0xA9C1; 
  99. pascal short Unique1ID(ResType theType)
  100.  = 0xA810; 
  101. pascal short GetResAttrs(Handle theResource)
  102.  = 0xA9A6; 
  103. pascal void GetResInfo(Handle theResource,short *theID,ResType *theType,
  104.  Str255 name)
  105.  = 0xA9A8; 
  106. pascal void SetResInfo(Handle theResource,short theID,ConstStr255Param name)
  107.  = 0xA9A9; 
  108. pascal void AddResource(Handle theResource,ResType theType,short theID,
  109.  ConstStr255Param name)
  110.  = 0xA9AB; 
  111. pascal long SizeResource(Handle theResource)
  112.  = 0xA9A5; 
  113. pascal long MaxSizeRsrc(Handle theResource)
  114.  = 0xA821; 
  115. pascal long RsrcMapEntry(Handle theResource)
  116.  = 0xA9C5; 
  117. pascal void SetResAttrs(Handle theResource,short attrs)
  118.  = 0xA9A7; 
  119. pascal void ChangedResource(Handle theResource)
  120.  = 0xA9AA; 
  121. pascal void RmveResource(Handle theResource)
  122.  = 0xA9AD; 
  123. pascal void UpdateResFile(short refNum)
  124.  = 0xA999; 
  125. Handle getnamedresource(ResType theType,char *name); 
  126. pascal void WriteResource(Handle theResource)
  127.  = 0xA9B0; 
  128. pascal void SetResPurge(Boolean install)
  129.  = 0xA993; 
  130. Handle get1namedresource(ResType theType,char *name); 
  131. pascal short GetResFileAttrs(short refNum)
  132.  = 0xA9F6; 
  133. pascal void SetResFileAttrs(short refNum,short attrs)
  134.  = 0xA9F7; 
  135. pascal short OpenRFPerm(ConstStr255Param fileName,short vRefNum,char permission)
  136.  = 0xA9C4; 
  137. pascal Handle RGetResource(ResType theType,short theID)
  138.  = 0xA80C; 
  139. #if SystemSevenOrLater
  140. pascal short HOpenResFile(short vRefNum,long dirID,ConstStr255Param fileName,
  141.  char permission)
  142.  = 0xA81A; 
  143. #else
  144. pascal short HOpenResFile(short vRefNum,long dirID,ConstStr255Param fileName,
  145.  char permission);
  146. #endif
  147. #if SystemSevenOrLater
  148. pascal void HCreateResFile(short vRefNum,long dirID,ConstStr255Param fileName)
  149.  = 0xA81B; 
  150. #else
  151. pascal void HCreateResFile(short vRefNum,long dirID,ConstStr255Param fileName);
  152. #endif
  153.  
  154. pascal short FSpOpenResFile(const FSSpec *spec,SignedByte permission)
  155.  = {0x303C,0x000D,0xAA52}; 
  156. pascal void FSpCreateResFile(const FSSpec *spec,OSType creator,OSType fileType,
  157.  ScriptCode scriptTag)
  158.  = {0x303C,0x000E,0xAA52}; 
  159. /*  partial resource calls  */
  160. pascal void ReadPartialResource(Handle theResource,long offset,void *buffer,
  161.  long count)
  162.  = {0x7001,0xA822}; 
  163. pascal void WritePartialResource(Handle theResource,long offset,const void *buffer,
  164.  long count)
  165.  = {0x7002,0xA822}; 
  166. pascal void SetResourceSize(Handle theResource,long newSize)
  167.  = {0x7003,0xA822}; 
  168.  
  169. short openrfperm(char *fileName,short vRefNum,char permission); 
  170. short openresfile(char *fileName); 
  171. void createresfile(char *fileName); 
  172. void getresinfo(Handle theResource,short *theID,ResType *theType,char *name); 
  173. void setresinfo(Handle theResource,short theID,char *name); 
  174. void addresource(Handle theResource,ResType theType,short theID,char *name); 
  175. #ifdef __cplusplus
  176. }
  177. #endif
  178.  
  179. #endif
  180.